package a.j;

import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.util.Arrays;

public class gb
{
  private double[] a;
  private int b;
  private double c = 10.0D;
  private double d = 5.0D;
  public static final short e = 0;
  public static final short f = 1;
  public static final short g = 2;
  public static final short h = 3;
  public static final short i = 4;
  public static final short j = 5;
  public static final short k = 6;
  public static final short l = 127;
  public static final short m = 1;
  public static final short n = 2;
  public static final short o = 3;
  public static final short p = 4;
  public static final short q = 5;
  public static final short r = 6;
  public static final short s = 7;
  public static final short t = 8;
  public static final short u = 0;
  public static final short v = 1;
  public static final short w = 2;
  private short x = 1;
  private short y = 5;
  private short z = 0;
  private Rectangle2D.Double A = new Rectangle2D.Double();
  private final fd B = new fd();
  private final double[] C = new double[6];
  double[] D = new double[''];
  public static int E;
  
  public gb(int paramInt)
  {
    this.a = new double[paramInt * 4];
  }
  
  public gb()
  {
    this(128);
  }
  
  public void a()
  {
    this.b = 0;
  }
  
  public short b()
  {
    return this.z;
  }
  
  public void a(short paramShort)
  {
    if (((!ld.E) && (paramShort < 0)) || (paramShort > 2)) {
      throw new IllegalArgumentException();
    }
    this.z = paramShort;
  }
  
  public short c()
  {
    return this.y;
  }
  
  public void b(short paramShort)
  {
    if ((ld.E) || ((paramShort < 1) || (paramShort > 8))) {
      throw new IllegalArgumentException();
    }
    this.y = paramShort;
  }
  
  public void c(short paramShort)
  {
    boolean bool = ld.E;
    if (((!bool) && (paramShort < 0)) || ((bool) || ((paramShort > 6) && (paramShort != 127)))) {
      throw new IllegalArgumentException();
    }
    this.x = paramShort;
  }
  
  public short d()
  {
    return this.x;
  }
  
  public double e()
  {
    return this.c;
  }
  
  public void a(double paramDouble)
  {
    this.c = paramDouble;
  }
  
  public double f()
  {
    return this.d;
  }
  
  public void b(double paramDouble)
  {
    this.d = paramDouble;
  }
  
  public void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    double d1 = 2.0D * this.c;
    double d2 = paramDouble1 - d1;
    double d3 = paramDouble2 - d1;
    double d4 = paramDouble3 + d1;
    double d5 = paramDouble4 + d1;
    this.A.setFrame(d2, d3, d4 - d2, d5 - d3);
  }
  
  public PathIterator a(PathIterator paramPathIterator)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    fd localfd = this.B;
    double[] arrayOfDouble = this.C;
    localfd.l();
    localfd.a(paramPathIterator);
    double d1 = 0.0D;
    double d2 = 0.0D;
    fd.h_ localh_ = localfd.a();
    if (localh_ != null) {
      if (!bool2) {
        switch (localh_.a())
        {
        case 4: 
          if (!bool2) {
            if (!bool1) {
              break;
            }
          }
          break;
        case 3: 
          localh_.a(arrayOfDouble);
          d1 = arrayOfDouble[4];
          d2 = arrayOfDouble[5];
          if (!bool2) {
            if (!bool1) {
              break;
            }
          }
          break;
        case 1: 
          localh_.a(arrayOfDouble);
          a(localfd, localh_, d1, d2, arrayOfDouble[0], arrayOfDouble[1]);
          d1 = arrayOfDouble[0];
          d2 = arrayOfDouble[1];
          if (!bool2) {
            if (!bool1) {
              break;
            }
          }
          break;
        case 0: 
          localh_.a(arrayOfDouble);
          d1 = arrayOfDouble[0];
          d2 = arrayOfDouble[1];
        }
      }
    }
    while (bool2)
    {
      if (!bool2)
      {
        if (bool1)
        {
          localh_.a(arrayOfDouble);
          d1 = arrayOfDouble[2];
          d2 = arrayOfDouble[3];
        }
        localh_ = localh_.b();
      }
      if (!bool1) {
        break;
      }
    }
    return localfd.getPathIterator(null);
  }
  
  public void b(PathIterator paramPathIterator)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double[] arrayOfDouble = this.C;
    double d1 = 0.0D;
    double d2 = 0.0D;
    do
    {
      if (paramPathIterator.isDone()) {
        break;
      }
      int i1 = paramPathIterator.currentSegment(arrayOfDouble);
      if (!bool2)
      {
        switch (i1)
        {
        case 4: 
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break;
          }
        case 3: 
          d1 = arrayOfDouble[4];
          d2 = arrayOfDouble[5];
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break;
          }
        case 1: 
          b(d1, d2, arrayOfDouble[0], arrayOfDouble[1]);
          d1 = arrayOfDouble[0];
          d2 = arrayOfDouble[1];
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break;
          }
        case 0: 
          d1 = arrayOfDouble[0];
          d2 = arrayOfDouble[1];
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break;
          }
        case 2: 
          d1 = arrayOfDouble[2];
          d2 = arrayOfDouble[3];
        }
        paramPathIterator.next();
      }
    } while (!bool1);
  }
  
  public void b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    if (!ld.E) {
      if (!this.A.intersectsLine(paramDouble1, paramDouble2, paramDouble3, paramDouble4)) {
        return;
      }
    }
    c(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
  }
  
  private void a(fd paramfd, fd.h_ paramh_, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (!this.A.intersectsLine(paramDouble1, paramDouble2, paramDouble3, paramDouble4)) {
        return;
      }
    }
    if (!bool2) {
      if (this.b > 0)
      {
        double d1 = paramDouble3 - paramDouble1;
        double d2 = paramDouble4 - paramDouble2;
        if ((bool2) || (this.z != 0))
        {
          if (!bool2) {}
          switch (this.z)
          {
          case 1: 
            if (!bool2) {
              if (Math.abs(d1) < Math.abs(d2)) {
                return;
              }
            }
            break;
          case 2: 
            if (!bool2) {
              if (Math.abs(d1) > Math.abs(d2)) {
                return;
              }
            }
            break;
          }
        }
        double d3 = Math.sqrt(d1 * d1 + d2 * d2);
        if (bool2) {
          break label568;
        }
        if (d3 > 0.0D)
        {
          double d4 = d1 / d3;
          double d5 = d2 / d3;
          int i1 = 0;
          int i2 = 0;
          do
          {
            if (i2 >= this.b) {
              break;
            }
            if (bool1) {
              break label517;
            }
            if (Line2D.linesIntersect(paramDouble1, paramDouble2, paramDouble3, paramDouble4, this.a[i2], this.a[(i2 + 1)], this.a[(i2 + 2)], this.a[(i2 + 3)]))
            {
              double d6 = this.a[i2];
              double d7 = this.a[(i2 + 1)];
              double d8 = this.a[(i2 + 2)] - d6;
              double d9 = this.a[(i2 + 3)] - d7;
              double d10 = d9 * d1 - d8 * d2;
              double d11 = (d8 * (paramDouble2 - d7) - d9 * (paramDouble1 - d6)) / d10;
              if (bool2) {
                continue;
              }
              if (d11 > 0.0D)
              {
                if (bool2) {
                  continue;
                }
                if (d11 < 1.0D)
                {
                  double d12 = (d1 * (paramDouble2 - d7) - d2 * (paramDouble1 - d6)) / d10;
                  if (bool2) {
                    continue;
                  }
                  if (d12 > 0.0D)
                  {
                    if (bool2) {
                      continue;
                    }
                    if (d12 < 1.0D)
                    {
                      double d13 = d11 * d3;
                      if (bool2) {
                        continue;
                      }
                      if (d13 > 0.1D)
                      {
                        if (bool2) {
                          continue;
                        }
                        if (d13 < d3 - 0.1D)
                        {
                          if ((bool2) || (i1 == this.D.length))
                          {
                            double[] arrayOfDouble = new double[this.D.length * 2];
                            System.arraycopy(this.D, 0, arrayOfDouble, 0, this.D.length);
                            this.D = arrayOfDouble;
                          }
                          this.D[(i1++)] = d13;
                        }
                      }
                    }
                  }
                }
              }
            }
            i2 += 4;
          } while (!bool1);
          if ((!bool2) && (i1 > 0))
          {
            label517:
            Arrays.sort(this.D, 0, i1);
            a(paramfd, paramh_, paramDouble1, paramDouble2, paramDouble3, paramDouble4, d1, d2, d4, d5, d3, this.D, i1);
          }
        }
      }
    }
    if ((bool2) || (this.z == 0)) {
      label568:
      c(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
    }
  }
  
  private void c(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (this.z != 0)
      {
        if (bool) {
          break label109;
        }
        switch (this.z)
        {
        case 1: 
          if (bool) {
            break label109;
          }
          if (Math.abs(paramDouble3 - paramDouble1) > Math.abs(paramDouble4 - paramDouble2)) {
            return;
          }
          break;
        case 2: 
          if (bool) {
            break label109;
          }
          if (Math.abs(paramDouble3 - paramDouble1) < Math.abs(paramDouble4 - paramDouble2)) {
            return;
          }
          break;
        }
      }
      if (bool) {
        break label203;
      }
    }
    label109:
    if (this.b == this.a.length)
    {
      double[] arrayOfDouble = new double[this.a.length * 2];
      System.arraycopy(this.a, 0, arrayOfDouble, 0, this.a.length);
      this.a = arrayOfDouble;
    }
    this.a[(this.b++)] = paramDouble1;
    this.a[(this.b++)] = paramDouble2;
    this.a[(this.b++)] = paramDouble3;
    label203:
    this.a[(this.b++)] = paramDouble4;
  }
  
  private void a(fd paramfd, fd.h_ paramh_, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6, double paramDouble7, double paramDouble8, double paramDouble9, double[] paramArrayOfDouble, int paramInt)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = this.c * 0.5D;
    double d2 = Math.max(0.0D, paramArrayOfDouble[0] - d1);
    double d3 = Math.min(paramDouble9, paramArrayOfDouble[0] + d1);
    int i1 = 1;
    do
    {
      if (i1 >= paramInt) {
        break;
      }
      double d5 = paramArrayOfDouble[i1];
      double d7 = Math.max(0.0D, d5 - d1);
      double d8 = Math.min(paramDouble9, d5 + d1);
      if (bool1) {
        break label214;
      }
      if (d7 > d3)
      {
        double d9 = paramDouble1 + d2 / paramDouble9 * paramDouble5;
        double d10 = paramDouble2 + d2 / paramDouble9 * paramDouble6;
        paramfd.b(d9, d10, paramh_);
        a(paramfd, paramh_, d2, d9, d10, d3, paramDouble1 + d3 / paramDouble9 * paramDouble5, paramDouble2 + d3 / paramDouble9 * paramDouble6, paramDouble7, paramDouble8);
        d2 = d7;
        d3 = d8;
        if (bool2) {
          continue;
        }
        if (!bool1) {}
      }
      else
      {
        d3 = d8;
      }
      i1++;
    } while (!bool1);
    if ((bool2) || (d3 > d2))
    {
      label214:
      double d4 = paramDouble1 + d2 / paramDouble9 * paramDouble5;
      double d6 = paramDouble2 + d2 / paramDouble9 * paramDouble6;
      paramfd.b(d4, d6, paramh_);
      a(paramfd, paramh_, d2, d4, d6, d3, paramDouble1 + d3 / paramDouble9 * paramDouble5, paramDouble2 + d3 / paramDouble9 * paramDouble6, paramDouble7, paramDouble8);
    }
  }
  
  private void a(fd paramfd, fd.h_ paramh_, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6, double paramDouble7, double paramDouble8)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    int i1 = d();
    boolean bool1 = a(paramDouble7, paramDouble8);
    switch (i1)
    {
    case 4: 
      d1 = paramDouble5 - paramDouble2;
      d2 = paramDouble6 - paramDouble3;
      if (!bool3) {
        if (bool1)
        {
          paramfd.a(paramDouble2 + d2 * 0.5D, paramDouble3 - d1 * 0.5D, paramDouble2 + (d2 + d1) * 0.5D, paramDouble3 + (d2 - d1) * 0.5D, paramh_);
          paramfd.a(paramDouble5 + d2 * 0.5D, paramDouble6 - d1 * 0.5D, paramDouble5, paramDouble6, paramh_);
          if (!bool3) {
            if (!bool2) {
              return;
            }
          }
        }
        else
        {
          paramfd.a(paramDouble2 - d2 * 0.5D, paramDouble3 + d1 * 0.5D, paramDouble2 + (d1 - d2) * 0.5D, paramDouble3 + (d1 + d2) * 0.5D, paramh_);
          paramfd.a(paramDouble5 - d2 * 0.5D, paramDouble6 + d1 * 0.5D, paramDouble5, paramDouble6, paramh_);
        }
      }
      if ((!bool3) && (!bool2)) {
        return;
      }
      break;
    case 1: 
      d1 = bool1 ? -this.d : this.d;
      d2 = (paramDouble4 - paramDouble1) * 0.5D;
      if (!bool3) {
        if (this.d < d2)
        {
          double d3 = this.d;
          paramfd.a(paramDouble2 - paramDouble8 * d1, paramDouble3 + paramDouble7 * d1, paramDouble2 - paramDouble8 * d1 + paramDouble7 * d3, paramDouble3 + paramDouble7 * d1 + paramDouble8 * d3, paramh_);
          paramfd.b(paramDouble5 - paramDouble8 * d1 - paramDouble7 * d3, paramDouble6 + paramDouble7 * d1 - paramDouble8 * d3, paramh_);
          paramfd.a(paramDouble5 - paramDouble8 * d1, paramDouble6 + paramDouble7 * d1, paramDouble5, paramDouble6, paramh_);
          if (!bool3) {
            if (!bool2) {
              return;
            }
          }
        }
        else
        {
          paramfd.a(paramDouble2 - paramDouble8 * d1, paramDouble3 + paramDouble7 * d1, paramDouble2 - paramDouble8 * d1 + paramDouble7 * d2, paramDouble3 + paramDouble7 * d1 + paramDouble8 * d2, paramh_);
          paramfd.a(paramDouble5 - paramDouble8 * d1, paramDouble6 + paramDouble7 * d1, paramDouble5, paramDouble6, paramh_);
        }
      }
      if (!bool3) {
        if (!bool2) {
          return;
        }
      }
    case 127: 
      a(paramfd, paramh_, paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramDouble5, paramDouble6);
      if (!bool3) {
        if (!bool2) {
          return;
        }
      }
    case 0: 
    default: 
      paramfd.a(paramDouble5, paramDouble6, paramh_);
      if (!bool2) {
        return;
      }
      break;
    case 5: 
      d1 = paramDouble5 - paramDouble2;
      d2 = paramDouble6 - paramDouble3;
      if (!bool3) {
        if (bool1)
        {
          paramfd.b(paramDouble2 + d2 * 0.5D, paramDouble3 - d1 * 0.5D, paramh_);
          paramfd.b(paramDouble5 + d2 * 0.5D, paramDouble6 - d1 * 0.5D, paramh_);
          paramfd.b(paramDouble5, paramDouble6, paramh_);
          if (!bool3) {
            if (!bool2) {
              return;
            }
          }
        }
        else
        {
          paramfd.b(paramDouble2 - d2 * 0.5D, paramDouble3 + d1 * 0.5D, paramh_);
          paramfd.b(paramDouble5 - d2 * 0.5D, paramDouble6 + d1 * 0.5D, paramh_);
          paramfd.b(paramDouble5, paramDouble6, paramh_);
        }
      }
      if ((!bool3) && (!bool2)) {
        return;
      }
      break;
    case 2: 
      d1 = bool1 ? -this.d : this.d;
      paramfd.b(paramDouble2 - paramDouble8 * d1, paramDouble3 + paramDouble7 * d1, paramh_);
      paramfd.b(paramDouble5 - paramDouble8 * d1, paramDouble6 + paramDouble7 * d1, paramh_);
      paramfd.b(paramDouble5, paramDouble6, paramh_);
      if ((!bool3) && (!bool2)) {
        return;
      }
      break;
    case 3: 
      d1 = bool1 ? -this.d : this.d;
      d2 = this.d;
      paramfd.b(paramDouble2 - paramDouble8 * d1 + paramDouble7 * d2, paramDouble3 + paramDouble7 * d1 + paramDouble8 * d2, paramh_);
      paramfd.b(paramDouble5 - paramDouble8 * d1 - paramDouble7 * d2, paramDouble6 + paramDouble7 * d1 - paramDouble8 * d2, paramh_);
      paramfd.b(paramDouble5, paramDouble6, paramh_);
      if (bool3) {
        break label975;
      }
      if (!bool2) {
        return;
      }
      break;
    }
    double d1 = paramDouble5 - paramDouble2;
    double d2 = paramDouble6 - paramDouble3;
    if (!bool3) {
      if (bool1)
      {
        label975:
        paramfd.b(paramDouble2 + (d2 + d1) * 0.5D, paramDouble3 + (d2 - d1) * 0.5D, paramh_);
        paramfd.b(paramDouble5, paramDouble6, paramh_);
        if (!bool3) {
          if (!bool2) {
            return;
          }
        }
      }
      else
      {
        paramfd.b(paramDouble2 + (d1 - d2) * 0.5D, paramDouble3 + (d1 + d2) * 0.5D, paramh_);
      }
    }
    paramfd.b(paramDouble5, paramDouble6, paramh_);
  }
  
  protected void a(fd paramfd, fd.h_ paramh_, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6) {}
  
  private boolean a(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      switch (c())
      {
      case 8: 
        return false;
      case 7: 
        return true;
      case 5: 
      default: 
        if (!bool) {
          if (Math.abs(paramDouble1) > Math.abs(paramDouble2))
          {
            if (!bool) {}
            return paramDouble1 >= 0.0D;
          }
        }
        if (!bool) {}
        return paramDouble2 >= 0.0D;
      case 6: 
        if (!bool) {
          if (Math.abs(paramDouble1) > Math.abs(paramDouble2))
          {
            if (!bool) {}
            return paramDouble1 <= 0.0D;
          }
        }
        if (!bool) {}
        return paramDouble2 <= 0.0D;
      case 1: 
        if (!bool) {
          if (paramDouble1 <= 0.0D)
          {
            if ((!bool) && (paramDouble1 != 0.0D)) {
              break label203;
            }
            if (bool) {
              break label200;
            }
          }
        }
        return paramDouble2 > 0.0D;
      case 2: 
        if (!bool) {
          if (paramDouble1 >= 0.0D)
          {
            if ((!bool) && (paramDouble1 != 0.0D)) {
              break label242;
            }
            if (bool) {
              break label239;
            }
          }
        }
        return paramDouble2 > 0.0D;
      case 4: 
        label200:
        label203:
        label239:
        label242:
        if (!bool) {
          if (paramDouble2 <= 0.0D)
          {
            if ((!bool) && (paramDouble2 != 0.0D)) {
              break label281;
            }
            if (bool) {
              break label278;
            }
          }
        }
        label278:
        label281:
        return paramDouble1 > 0.0D;
      }
    }
    if (!bool) {
      if (paramDouble2 >= 0.0D)
      {
        if ((!bool) && (paramDouble2 != 0.0D)) {
          break label320;
        }
        if (bool) {
          break label317;
        }
      }
    }
    label317:
    label320:
    return paramDouble1 > 0.0D;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.gb

 * JD-Core Version:    0.7.0.1

 */